/**
 * 
 */
package com.luxsoft.siipap.em.replica.importadores;

import java.text.MessageFormat;

import org.apache.commons.lang.exception.ExceptionUtils;

public class ImportError{
	
	private Throwable exception;
	private String message;
	private Object id;
	
	public ImportError() {		}
	
	public ImportError(Throwable exception, Object id, String message) {			
		this.exception = exception;
		this.id = id;
		this.message = message;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Throwable getException() {
		return exception;
	}
	public void setException(Throwable exception) {
		this.exception = exception;
	}
	public Object getId() {
		return id;
	}
	public void setId(Object id) {
		this.id = id;
	}
	
	public String toString(){
		String pattern="{0} Id:{1,number,#} {2} {3}";
		return MessageFormat.format(pattern, message,id
				,ExceptionUtils.getMessage(exception)
				,ExceptionUtils.getRootCauseMessage(exception));
	}
	
}